<template>
<div class="recom-out">
    <div class="recom-item" @click="clickitem" v-for="(item,index) in recommendList" :key="index">
        <img :src="item.blogImage" alt="">
        <div class="item-text">
          <h4>{{item.blogTitle}}</h4>
          <p>{{item.blogRemark}}</p>
        </div>
    </div>
</div>
</template>

<script>
export default{
  name: 'recomitem',
  props: {
    recommendList: {
        type: Array,
        default() {
            return []
        }
    }
},
  methods: {
    clickitem() {
      this.$emit('clickrecitem')
    }
  }
}
</script>

<style scoped>
.recom-item{
  float: left;
  display: flex;
  padding: 12px 20px 12px 20px;
  width: 420px;
  background-color: #f7f7f7;
  border-bottom: 3px solid #f1f1f1;
}
.recom-item:hover{
  cursor: pointer;
  background-color: rgba(201, 255, 214, 0.3);
  color: #65c265;
}
.recom-item img{
  width: 100px;
  height: 68px;
  border-radius: 5px;
}
.item-text{
  width: 75%;
  padding-left: 10px;
}
.item-text h4{
  width: 75%;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
.item-text p{
  font-size: 14px;
  color: #a1a1a1;
}
</style>
